﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Area.aspx.cs" Inherits="Formularios_Area" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 150px;
        }
        .style2
        {
            width: 630px;
        }
        .style3
        {
            width: 150px;
            height: 21px;
        }
        .style4
        {
            width: 630px;
        }
        .style5
        {
            height: 21px;
        }
        .style6
        {
            width: 630px;
            height: 21px;
        }
        .style7
        {
            width: 150px;
            height: 26px;
        }
        .style8
        {
            width: 630px;
            height: 26px;
        }
        .style9
        {
            height: 26px;
        }
        .style10
        {
            width: 150px;
            height: 31px;
        }
        .style11
        {
            width: 630px;
            height: 31px;
        }
        .style12
        {
            height: 31px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <table style="width: 98%;">
        <tr>
            <td class="style3">
            </td>
            <td align="center" bgcolor="#536D95" class="style4" rowspan="2" 
                style="font-family: Arial, Helvetica, sans-serif; font-size: xx-large; font-weight: bold; color: #FFFFFF">
                Registro De Areas</td>
            <td class="style5">
            </td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" class="style2">
                <asp:Label ID="lblMensaje" runat="server" ForeColor="Red"></asp:Label>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" class="style2">
                <hr />
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                <asp:TextBox ID="txtID" runat="server" ValidationGroup="Gtxt" Visible="False"></asp:TextBox>
            </td>
            <td align="center" class="style6" 
                style="border-style: solid solid none solid; border-width: thin; border-color: #536D95;">
            </td>
            <td class="style5">
            </td>
        </tr>
        <tr>
            <td class="style7">
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtNombre" ErrorMessage="RegularExpressionValidator" 
                    Font-Size="Smaller" ForeColor="Red" ValidationExpression="^[a-zA-ZñÑ\s]*$" 
                    ValidationGroup="Gtxt">Debe introducir solo letras</asp:RegularExpressionValidator>
            </td>
            <td align="center" class="style8" 
                style="border-style: none solid none solid; border-width: thin; border-color: #536D95; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #000000;">
                <asp:TextBox ID="txtNombre" runat="server" Height="22px" Width="250px" 
                    ValidationGroup="Gtxt"></asp:TextBox>
                <br />
                Nombre</td>
            <td class="style9">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtNombre" ErrorMessage="RequiredFieldValidator" 
                    Font-Size="Smaller" ForeColor="Red" ValidationGroup="Gtxt">Debe introducir un nombre</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" class="style2" 
                style="border-style: none solid none solid; border-width: thin; border-color: #536D95;">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style10">
            </td>
            <td align="center" class="style11" 
                style="border-style: none solid none solid; border-width: thin; border-color: #536D95;">
                <asp:LoginView ID="LoginView1" runat="server">
                    <RoleGroups>
                        <asp:RoleGroup Roles="Administrador">
                            <ContentTemplate>
                                <asp:Button ID="btnRegistrar" runat="server" Text="Registrar" 
                                ValidationGroup="Gtxt" onclick="btnRegistrar_Click" />
                            </ContentTemplate>
                        </asp:RoleGroup>
                    </RoleGroups>
                </asp:LoginView>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:LoginView ID="LoginView2" runat="server">
                    <RoleGroups>
                        <asp:RoleGroup Roles="Administrador">
                            <ContentTemplate>
                                <asp:Button ID="btnModificar" runat="server" Text="Modificar" 
                                ValidationGroup="Gtxt" onclick="btnModificar_Click" />
                            </ContentTemplate>
                        </asp:RoleGroup>
                    </RoleGroups>
                </asp:LoginView>
            </td>
            <td class="style12">
            </td>
        </tr>
        <tr>
            <td class="style3">
            </td>
            <td align="center" class="style6" 
                style="border-style: none solid solid solid; border-width: thin; border-color: #536D95;">
            </td>
            <td class="style5">
            </td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" class="style2">
                <asp:GridView ID="grvAreas" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" 
                    GridLines="None" ShowHeaderWhenEmpty="True" 
                    onrowcommand="grvAreas_RowCommand" Caption="Lista Areas">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:BoundField DataField="Codigo" HeaderText="Codigo">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Nombre" HeaderText="Nombre">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="200px" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Seleccionar">
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            <ItemTemplate>
                                <asp:ImageButton CommandName="Seleccionar" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"codigo") %>' runat="server" ID="Edit" ImageUrl='~/Imagenes/Seleccionar.png' />
			                </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Eliminar">
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            <ItemTemplate>
                                    <asp:ImageButton CommandName="Eliminar" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"codigo") %>' runat="server" ID="Delete" ImageUrl='~/Imagenes/Eliminar.png' />
			                </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td align="center" class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

